package cn.lanca.gof0_5._04abstract_factory;

import com.example.demo.gof0_5._04abstract_factory.service.Animal;
import com.example.demo.gof0_5._04abstract_factory.service.Farm;
import com.example.demo.gof0_5._04abstract_factory.service.Plant;
import com.example.demo.gof0_5._04abstract_factory.util.ReadXML;

/**
 * @author meihongliang
 * @since 2020/8/5 17:23
 */
public class Main {
    public static void main(String[] args) {
        try {
            Farm f;
            Animal a;
            Plant p;
            f = (Farm) ReadXML.getObject();
            a = f.newAnimal();
            p = f.newPlant();
            a.show();
            p.show();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
